package com.huawei.rbac.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 树状节点
 *
 * @author caohy
 * @version 2021年6月16日上午11:09:49
 *
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TreeNode<T> implements Serializable {

	private static final long serialVersionUID = 5325905074623082448L;

	/**
	 * 节点ID
	 */
	private T id;

	/**
	 * 父节点ID
	 */
	private T parentId;
	
	/**
	 * 节点名称
	 */
	private String name;

	/**
	 * 子节点列表
	 */
	private List<TreeNode<T>> children = new ArrayList<>();

	public TreeNode(T id, T parentId, String name) {
		super();
		this.id = id;
		this.parentId = parentId;
		this.name = name;
	}

}
